Function.prototype.before = function (fn){
        let _this = this
        return function (){
            let [a,b] = [...arguments]
            fn(b)
            _this(a)
        }
}
Function.prototype.after = function (fn){
    let _this = this
    return function (){
        let [a,b,c] = [...arguments]
        _this(a,b,c)
            fn(c)

    }   
}
function test(a){
    console.log(a);
}
function test2(a){
    console.log(a);
}
let test3 = test.before(test2)

test3('a','b')

let test4 = test3.after(test)
test4('a','b','c')

//结果：b a b a c